package Task5;

import java.util.Scanner;

public class Main2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String str = scanner.next();
            String str2 = scanner.next();
            int count = 0;
            for (int i = 0; i <= str.length(); i++) {
                StringBuilder stringBuilder = new StringBuilder(str);
                stringBuilder.insert(i,str2);
                StringBuilder stringBuilder1 = new StringBuilder(stringBuilder);
                stringBuilder.reverse();
                if(stringBuilder1.toString().equals(stringBuilder.toString())){
                    count++;
                }
            }
            System.out.println(count);
        }
    }
}
